package Dao;

import static org.junit.Assert.*;

import java.util.ArrayList;
import java.util.List;

import org.junit.Before;
import org.junit.Test;

import Entity.MyDownload;

public class MyDownloadDaoTest {
	MyDownload md=new MyDownload("20161946","2018194620190617125","sqlsever","AirTicketSystem.zip","20161946","20190617","这是数据库课程设计");
	MyDownloadDao mdd=new MyDownloadDao();
	List<MyDownload> mdlist=new ArrayList<MyDownload>();

	@Before
	public void setUp() throws Exception {
	}

	@Test
	public void testAddMyDownload() {
		assertEquals(1,mdd.addMyDownload(md));
	}

	@Test
	public void testDeleteMyDownloadByResourceId() {
		assertEquals(1,mdd.deleteMyDownloadByResourceId("2016194520190617101"));
	}

	@Test
	public void testQueryAllDownloadByNo() {
		mdlist=mdd.queryAllDownloadByNo("20161946");
		for(int i=0;i<mdlist.size();i++) {
		assertEquals("20161946",mdlist.get(i).myNo);
		}
	}

}


